import java.awt.Color;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JPanel;



public class AnimationJFrame  extends JFrame {

	JPanel primaryPanel;
	
	public AnimationJFrame()
	{
		primaryPanel = new AnimationJPanel(500,500);
		primaryPanel.setBackground(Color.white);
		primaryPanel.setFocusable(true); //Needed for key events
		
    
		setBackground(Color.blue);
		setSize(500,500);
		setContentPane(primaryPanel);
		addWindowListener(new WindowAdapter()
		{
			public void windowClosing(WindowEvent event)
			{
				System.exit(0);
			}
			
		});
		setVisible(true);
	}
	
	public static void main(String [] args)
	{
		new AnimationJFrame();
		
	}
	
}
